import Vue from 'vue'
import Vuex from 'vuex'
import persistedState from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
  plugins: [
    persistedState({ storage: window.sessionStorage })
  ],
  state: {
    city: '上海',
    valueId: 'AREA|dbf46d32-7e76-1196',
    roomRecord: []
  },
  mutations: {
    setCity (state, payload) {
      state.city = payload.label
      state.value = payload.value
    },
    setRecord (state, payload) {
      state.roomRecord.push(payload)
      console.log(state.roomRecord)
    }
  },
  actions: {
  },
  modules: {
  }
})
